package com.luoqiu.yygh.oss.controller;

import com.luoqiu.yygh.common.result.Result;
import com.luoqiu.yygh.oss.service.OssService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping(value = "/api/oss/file")
public class FileApiController {

    @Autowired
    private OssService ossService;

    @PostMapping(value = "fileUpload")
    public Result<Object> fileUpload(MultipartFile file) {
        return Result.ok(ossService.fileUpload(file));
    }
}
